<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //回调嵌套

    function five() {
        setTimeout(() => {

            console.log('5');

        }, 1000);
    }



    function four(callback) {
        setTimeout(() => {

            console.log('4');
            callback()
        }, 1000);
    }



   function three(callback) {
        setTimeout(() => {

            console.log('3');
        callback(five)
        }, 500);
    }


    function two(call) {
        console.log(2);
        call(four);
    }


    function one(callBack) {
        setTimeout(() => {

            console.log('1');
            callBack(three)
        }, 0);
    }






    one(two)
</script>
</body>
</html>